package org.example.calc;

/**
 * @author TonySong
 * @date 2024/5/7 0007
 * @time 14:35
 */
public class OperationFactory {

    public static Operation createOperation(char op,int a,int b){
         Operation operation =null;
         switch (op){
             case '+' ->{
                  operation = new Add(a,b);
             }
             case '-' ->{
                 operation = new Sub(a,b);
             }
             case '*' ->{
                 operation = new Mul(a,b);
             }
             case '/' ->{
                 operation = new Div(a,b);
             }
         }
         return operation;
    }

}
